package cn.zhangchg.leetcode.arrays;

import java.util.Arrays;
import java.util.Random;

public class RandomArrayUtils {
    public static void main(String[] args) {
        for (int i = 0; i < 1000; i++) {
            System.err.println(toString(generateRandomArray(10,100,20)));
        }
    }
    public static int[] generateRandomArray(int length,int maxSize,int minSize){
        Random random = new Random();
        int[] ints = new int[Math.abs(random.nextInt(length)) + 1];
        for (int i = 0; i < ints.length; i++) {
            ints[i] = random.nextInt(maxSize - minSize) + minSize;
        }
        return ints;
    }
    public static String toString(int[] ints){
        return Arrays.toString(ints);
    }
}
